#include "connectionparammodel.h"
#include "parametrscontroller.h"
#include "abstractappsettingsstorage.h"

ParametrsController::ParametrsController(ConnectionParamModel *connectionParamModel, QObject *parent) :
	QObject(parent),
	mConnectionParamModel(connectionParamModel)
{
	mConnectionParamModel->setHost(SETTINGS.host());
	mConnectionParamModel->setLogin(SETTINGS.login());
	mConnectionParamModel->setPassword(SETTINGS.password());
}

void ParametrsController::setHost(const QString &host){
	mConnectionParamModel->setHost(host);
	SETTINGS.saveHost(host);
}

void ParametrsController::setLogin(const QString &login){
	mConnectionParamModel->setLogin(login);
	SETTINGS.saveLogin(login);
}

void ParametrsController::setPassword(const QString &password){
	mConnectionParamModel->setPassword(password);
	SETTINGS.savePassword(password);
}
